package org.example.bean;

import java.util.HashMap;
import java.util.List;
import java.util.Objects;

/**
 * @Desc:地图疆域
 * @Author: yanghongjun
 * @Date: 2025/6/10
 **/
public class Territory {
    /**
     * 疆域id
     */
    private int id;

    /**
     * 相邻的疆域<疆域，关卡列表>
     */
    private HashMap<Territory, List<MapPass>> nextTerritory = new HashMap<Territory, List<MapPass>>();

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }


    public HashMap<Territory, List<MapPass>> getNextTerritory() {
        return nextTerritory;
    }

    public void setNextTerritory(HashMap<Territory, List<MapPass>> nextTerritory) {
        this.nextTerritory = nextTerritory;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Territory)) {
            return false;
        }
        Territory obj = (Territory) o;
        return getId() == obj.getId();
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    public Territory() {
    }

    public Territory(int id) {
        this.id = id;
    }
}
